package com.primeton.whdc.ccms.reportapi.client;

import com.primeton.whdc.ccms.reportapi.client.fallback.RecordServerClientFallback;
import com.primeton.whdc.ccms.reportapi.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by jinyabin on 2020/10/19.
 */
@Api(tags = {"日报管理"})
@FeignClient(name = "report-server",configuration = FeignAutoConfiguration.class,fallback = RecordServerClientFallback.class)
public interface ApicallRecordClient {

    @ResponseBody
    @GetMapping(value = "/call/records", produces = {"application/json;charset=UTF-8"})
    @ApiOperation(value = "查询日报调用列表")
    public Result list(@RequestParam long page,
                       @RequestParam long limit,
                       @RequestParam(required = false) String empCode,
                       @RequestParam(required = false) String empName,
                       @RequestParam(required = false) String deptCode,
                       @RequestParam(required = false) String appCode,
                       @RequestParam(required = false) String sysCode,
                       @RequestParam(required = false) String apiName,
                       @ApiParam("开始日期") String beginDate,
                       @ApiParam("结束日期") String endDate) ;



    @ResponseBody
    @GetMapping(value = "/report/month", produces = {"application/json;charset=UTF-8"})
    @ApiOperation(value = "查询日报月调用报表")
    public Result reportMonth(@RequestParam(required = true) String empCode,
                              @RequestParam(required = true) String deptCode,
                              @RequestParam(required = true) String queryRange) ;




    @ResponseBody
    @GetMapping(value = "/report/week", produces = {"application/json;charset=UTF-8"})
    @ApiOperation(value = "查询日报周调用报表")
    public Result reportWeek(@RequestParam(required = true) String empCode,
                             @RequestParam(required = true) String deptCode,
                             @RequestParam(required = true) String queryRange) ;


}
